package com.hxy.provider;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Sender {
    @Autowired
    private AmqpTemplate template;

    @Value("${mq.config.exchange}")
    private String exchange;

    public void xxSend(String msg) {
        template.convertAndSend(exchange,"xx.log.debug","xx-debug" + msg);
        template.convertAndSend(exchange,"xx.log.info","xx-info" + msg);
        template.convertAndSend(exchange,"xx.log.error","xx-error" + msg);
        template.convertAndSend(exchange,"xx.log.warn","xx-warn" + msg);
    }
    public void proSend(String msg) {
        template.convertAndSend(exchange,"pro.log.debug","pro-debug" + msg);
        template.convertAndSend(exchange,"pro.log.info","pro-info" + msg);
        template.convertAndSend(exchange,"pro.log.error","pro-error" + msg);
        template.convertAndSend(exchange,"pro.log.warn","pro-warn" + msg);
    }
    public void plusSend(String msg) {
        template.convertAndSend(exchange,"plus.log.debug","plus-debug" + msg);
        template.convertAndSend(exchange,"plus.log.info","plus-info" + msg);
        template.convertAndSend(exchange,"plus.log.error","plus-error" + msg);
        template.convertAndSend(exchange,"plus.log.warn","plus-warn" + msg);
    }

}
